#include <stdio.h>

int main() {
    int n, y;
    int a[20];
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }
    scanf("%d", &y);

    int l = 0, r = n - 1;
    int count = 0;
    int found = 0;
    int pos = -1;

    while (l <= r) {
        int mid = (l + r) / 2;
        count++;
        if (a[mid] == y) {
            found = 1;
            pos = mid;
            break;
        } else if (a[mid] < y) {
            l = mid + 1;
        } else {
            r = mid - 1;
        }
    }

    if (!found) {
        printf("not found\n");
        return 0;
    }

    int ll = pos;
    while (ll > 0 && a[ll - 1] == y) {
        ll--;
    }

    int rr = pos;
    while (rr < n - 1 && a[rr + 1] == y) {
        rr++;
    }

    printf("查找次数%d\n", count);
    for (int i = ll; i <= rr; i++) {
        printf("位置:%d\n", i);
    }

    return 0;
}